
/**
 * 作者：I-AM-WASTE
 * TIME:2022-10-12
 */

let v = new Vue({
    el:"#artBody",
    data:{
        artWordUp:{
            gameTitle:'',
            videoUrl:'',
            gameImgMain:'',
            imgUrlOne:'',
            imgUrlTwo:'',
            imgUrlTree:'',
            imgUrlFour:'',
            imgUrlFive:'',
            gameBot:'',
            gameTop:'',
            h2One:'',
            h2Too:'',
            h2Tree:'',
            pone:'',
            ptoo:'',
            ptree:'',
            gameBody:'',
            gameArticle:'',
            gameFl:'',
            imgUrlSix:'',
            gameTs:'',
            gameUptime: null
        },
    },
    methods:{
        fl(title){
            v.artWordUp.gameFl = title
        },
        updata(){
            axios.post("/back/add",v.artWordUp).then(function (response){
                v.artWordUp.gameTitle = '';
                v.artWordUp.videoUrl = '';
                v.artWordUp.gameImgMain = '';
                v.artWordUp.imgUrlOne = '';
                v.artWordUp.imgUrlTwo = '';
                v.artWordUp.imgUrlTree = '';
                v.artWordUp.imgUrlFour = '';
                v.artWordUp.imgUrlFive = '';
                v.artWordUp.gameBot = '';
                v.artWordUp.gameTop = '';
                v.artWordUp.h2One = '';
                v.artWordUp.h2Too = '';
                v.artWordUp.h2Tree = '';
                v.artWordUp.pone = '';
                v.artWordUp.ptoo = '';
                v.artWordUp.ptree = '';
                v.artWordUp.gameBody = '';
                v.artWordUp.gameArticle = '';
                v.artWordUp.gameFl = '';
                v.artWordUp.imgUrlSix = '';
                v.artWordUp.gameTs = '';



                if (response.data === 'ok'){
                    v.$Message.success({
                        content: "修改成功！祝贺",
                        duration: 5
                    });
                }else {
                    v.$Message.error({
                        content: "服务器娘发生错误(っ °Д °;)っ",
                        duration: 5
                    });
                }
            })

        },
    }
})


let z = new Vue({
    el:"#hander-finx",
    data:{
        i:null
    },
    methods: {
        loginout(){
            axios.post("/loginout").then(function (response){
                z.$Message.success({
                    content: "退出成功！（；´д｀）ゞ",
                    duration: 3
                });
                this.i = setTimeout(()=>{
                    //需要延迟的代码 :3秒后延迟跳转到首页，可以加提示什么的
                    window.location.href = "/login"
                    //延迟时间：3秒
                },3000)
            })
        }
    },
    beforeDestroy(){
        clearTimeout(this.i)
    }
})

let year = document.getElementById("newyear")
year.innerText = ""+new Date().getFullYear()+""